<style type="text/css">
<!--
ul.thumbnails
{
    list-style-type: none;
}
ul.thumbnails li
{
    margin: 1px;
    border: 1px solid navy;
    float: left;
    vertical-align: middle;
    text-align: center;
    width: 100px;
    height: 100px;
    padding: 3px;
    font-size: 0.7em;
}
.highlight
{
    background-color: yellow;
}
-->
</style>
<?php if(count($attachments)==0) : ?>
<p><?php echo CHtml::encode(Yii::t('site','There are no attachments yet.')); ?></p>
<?php else : ?>
<ul id="<?php echo $htmlOptions['id'] ?>" class="attachments thumbnails">
    
    <?php foreach($attachments as $n=>$attachment) : ?>
    <li id="<?php echo get_class($model) ?>_attachment_<?php echo $n ?>" path="<?php echo $attachment['path'] ?>" class="draggable">
        <?php echo CHtml::link(
            CHtml::image(
                Yii::app()->baseUrl.'/thumb.php?image='.$attachment['url'].'&x=90', 
                'image',
                array('border'=>0)
            ),
            Yii::app()->baseUrl.'/download.php?dl='.base64_encode('path='.$attachment['path']),
            array(
                'target'=>'_blank',
                'title'=>Yii::t('site','Click to open image {image} in a new tab',array('{image}' => basename($attachment['path'])))
            )); ?>
        <p><?php echo basename($attachment['path']); ?></p>
    </li>
    <?php endforeach; ?>
    <?php if($showTrash) : ?>
    <li id="attachments_trash" ><?php echo ICON_DELETE ?><p>Drag here to delete</p></li>
    <?php endif; ?>
</ul>
<?php endif; ?>
<div style="clear:left"></div>
